package com.zq.spring.springexpand;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @Author: zhaoqi
 * @Date: 2020/4/30 15:48
 * @Version 1.0
 */

// bean 后置处理器   看这个自定义类   MyInstantiationAwareBeanPostProcessor     也实现了BeanPostProcessor
/*
            --> Spring IOC容器实例化Bean
            --> 调用BeanPostProcessor的postProcessBeforeInitialization方法
            --> 调用bean实例的初始化方法
            --> 调用BeanPostProcessor的postProcessAfterInitialization方
            */

public class MyBeanPostProcessor implements BeanPostProcessor {

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        if (beanName.equals("")){

        }
        return null;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        return null;
    }
}
